<!--
 * @Description: 培训学员考勤签到表 
 * @Autor: dyx
 * @Date: 2023-06-02 13:36:17
 * @LastEditTime: 2023-06-02 14:12:01
-->
<template>
  <div class="A6_PXXXKQQDB">
    <el-button type="primary" @click="exportLearningRecord" style="margin-bottom: 10px;">导出学习记录</el-button>
    <JADP-table v-loading="listLoading" :data="list" height="70vh">
      <el-table-column prop="className" label="班级名称" align="left" show-overflow-tooltip />
      <el-table-column prop="studentName" label="学员名称" align="left" show-overflow-tooltip />
      <el-table-column prop="curriculumname" label="课程名称" align="left" show-overflow-tooltip />
      <el-table-column label="课件名称" prop="coursewarename" algin="left" show-overflow-tooltip />
      <el-table-column label="开始学习时间" prop="starttime" algin="left" show-overflow-tooltip />
      <el-table-column label="结束学习时间" prop="endtime" algin="left" show-overflow-tooltip />
      <el-table-column label="学习时长" prop="learnduration" algin="left" />
    </JADP-table>
    <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="init" />
  </div>
</template>
<script>
import request from "@/utils/request";
export default {
  name: "A6_PXXXKQQDB",
  data() {
    return {
      list: [],
      listLoading: true,
      total: 0,
      listQuery: {
        currentPage: 1,
        pageSize: 20,
        sort: "desc",
        sidx: ""
      },
      classid: ""
    };
  },
  methods: {
    init(id, flag) {
      if (flag) {
        this.classid = id;
      }
      this.listLoading = true;
      let _query = {
        ...this.listQuery,
        classid: this.classid,
        organizeId: this.$store.getters.organizeId
      };
      request({
        url: `/api/xy_kj_process_records/Xy_kj_process_records/getRecordsList`,
        method: "get",
        data: _query
      }).then(res => {
        this.list = res.data.list;
        this.total = res.data.pagination.total;
        this.listLoading = false;
      });
    },
    exportLearningRecord() {
      request({
        url: `/api/xy_kj_process_records/Xy_kj_process_records/Actions/Export`,
        method: "get",
        data: {
          classid: this.classid,
          organizeId: this.$store.getters.organizeId
        }
      }).then(res => {
        // console.log(res, 456);
        window.location.href = this.define.comUrl + res.data.url;
      });
    }
  }
};
</script>
<style scoped lang="scss"></style>
